package com.fs.files.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClient;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@Data
public class OSSConfig {
    @Value("${aliyun.endpoint:oss-cn-beijing.aliyuncs.com}")
    private String endpoint;

    @Value("${aliyun.accessKeyId:LTAI4G8WjyzbdXAAVYEypm6W}")
    private String accessKeyId;

    @Value("${aliyun.accessKeySecret:3LoApG25ynUihlJegQiAlNn2bvEbjh}")
    private String accessKeySecret;

    @Value("${aliyun.bucketName:pps-mpc}")
    private String bucketName;

    @Value("${aliyun.urlPrefix:pps-mpc.oss-cn-beijing.aliyuncs.com}")
    private String urlPrefix;

    @Bean
    public OSS oSSClient() {
        return new OSSClient(endpoint, accessKeyId, accessKeySecret);
    }
}
